package com.greenantmall.view;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;

import com.greenantmall.R;

public class DeleteShoppingCartDialog extends Dialog implements android.view.View.OnClickListener {
	private Button mBtnSure;
	private Button mBtnCancel;
	
	public interface DeleteShoppingCartDialogListener {
		public void btnSureClicked();
	}
	
	private DeleteShoppingCartDialogListener mListener;
	
	public DeleteShoppingCartDialog(Context context, DeleteShoppingCartDialogListener listener) {
		super(context, R.style.choose_date_dialog_style);
		setContentView(R.layout.delete_shopping_cart_dialog);
		
		mListener = listener;
		
		mBtnSure = (Button)findViewById(R.id.delete_shopping_cart_dialog_bottom_btn_sure);
		mBtnCancel = (Button)findViewById(R.id.delete_shopping_cart_dialog_bottom_btn_cancel);
		mBtnSure.setOnClickListener(this);
		mBtnCancel.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		if(v.equals(mBtnSure)) {
			if(mListener != null) {
				mListener.btnSureClicked();
			}
			this.dismiss();
		}
		else if(v.equals(mBtnCancel)) {
			this.dismiss();
		}
	}
}















